//package com.auth.proejct.cn.controller;
//
//
//import com.auth.proejct.cn.service.MyUserDetailService;
//import com.auth.project.cn.entity.Result;
//import com.auth.project.cn.enumeration.ResultCode;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.security.oauth2.provider.token.ConsumerTokenServices;
//import org.springframework.web.bind.annotation.DeleteMapping;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import java.security.Principal;
//
///**
// * 〈会员Controller〉
// */
//@Slf4j
//@RestController
//@RequestMapping("/api")
//public class MemberController {
//
//    @Autowired
//    private MyUserDetailService userDetailService;
//
//    @Autowired
//    private ConsumerTokenServices consumerTokenServices;
//
//    @GetMapping("/member")
//    public Principal user(Principal member) {
//        log.info("用户信息:{}", member);
//
//        return member;
//    }
//
//    @DeleteMapping(value = "/exit")
//    public Result revokeToken(String access_token) {
//        Result result = new Result();
//        if (consumerTokenServices.revokeToken(access_token)) {
//            result.setCode(ResultCode.SUCCESS.getCode());
//            result.setMessage("注销成功");
//        } else {
//            result.setCode(ResultCode.FAILED.getCode());
//            result.setMessage("注销失败");
//        }
//        return result;
//    }
//}
